<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>法律产品</title>
	<link rel="stylesheet" type="text/css" href="css/normalize.css">
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="css/my-style.css">
	<!--[if lt IE 9]> 
		<script src="js/html5shiv.min.js"></script> 
	<![endif]-->
</head>
  
  <body>
	<!-- 导航栏 -->
	<header>
		<nav class="navbar navbar-inverse">
			<div class="container">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1" aria-expanded="false">
		        <span class="sr-only">Toggle navigation</span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		      </button>
		      <a class="navbar-brand" href="index.html">
		        <img alt="LOGO" src="img/logo.png">
		      </a>
				</div>
				<div class="collapse navbar-collapse" id="navbar-collapse-1">
					<ul class="nav navbar-nav navbar-left">
						  <li><a href="index/home">首页</a></li>
				          <li><a href="lawyer/list">法律人</a></li>
				          <li class="cur"><a href="contract/list">法律产品</a></li>
				         <li><a href="knowledge/index">法律知识</a></li>
				          <li><a href="javascript:;">招聘</a></li>
					</ul>
					<ul class="nav navbar-nav navbar-right">
						<li><a class="add-btn" href="index/join">法律人入驻<span class="caret"></span></a></li>
						<c:if test="${sessionScope.user == null}">
							<li><a href="user/login">登录</a></li>
							<li><a href="user/register">注册</a></li>
						</c:if>
						<c:if test="${sessionScope.user != null}">
							 <li>
								<c:if test="${sessionScope.user.type  == 0}">
								<a href="user/person">${sessionScope.user.username}</a>
								</c:if>
								<c:if test="${sessionScope.user.type  == 1}">
								<a href="lawyer/person">${sessionScope.user.username}</a>
								</c:if>
								<c:if test="${sessionScope.user.type  == 2}">
								<a href="lawyer/person">${sessionScope.user.username}</a>
								</c:if>
					    	</li>
							<li><a href="user/logout">退出</a></li>
						</c:if>
				</ul>
				</div>
			</div>
		</nav>
	</header>

	<section>
		<div class="container">
			<div class="row">
				<div class="col-md-12 col-sm-12 col-xs-12">
					<div class="list-select-border">
						<div class="list-select-box clearfix">
							<div class="pull-left list-label">
								<label>合同分类:</label>
							</div>
							<div class="pull-left list-select">
								<ul class="list-select-ul clearfix" id="list-select-ul1">
									<li <c:if test="${typeId == 0}">class="selected"</c:if> id="0"><a href="contract/list?type=0">全部</a></li>
									<li <c:if test="${typeId == 1}">class="selected"</c:if> id="1"><a href="contract/list?type=1">房地产相关</a></li>
									<li <c:if test="${typeId == 2}">class="selected"</c:if> id="2"><a href="contract/list?type=2">劳动相关</a></li>
									<li <c:if test="${typeId == 3}">class="selected"</c:if> id="3"><a href="contract/list?type=3">知识产权相关</a></li>
								</ul>
							</div>
						</div>
						<c:if test="${show==1}">
						<div class="list-select-box clearfix" id="list-select-box2">
							<div class="pull-left">
								<label>合同细分:</label>
							</div>
							<div class="pull-left list-select">
								<ul class="list-select-ul clearfix" id="list-select-ul2">
									<li <c:if test="${s == 0}">class="selected"</c:if> data-id="${typeId}"  data-s="0"><a href="javascript:;">全部</a></li>
									<c:forEach items="${type}" var="type">
										<li <c:if test="${s == type.typeid}">class="selected"</c:if> data-id="${typeId}"  data-s="${type.typeid}"><a href="javascript:;">${type.name}</a></li>
									</c:forEach>
								</ul>
							</div>
						</div>
						</c:if>

						
						
					</div>	

				</div>
			</div>
			<div class="row" style="margin-top:20px;">
				<c:forEach items="${conList}" var="conList">
				<a href="contract/detail/${conList.id}">
					<div class="col-md-3 col-sm-6 col-xs-12">
						<div class="product-box center-block">
							<div class="title-box center-block text-center">							
								<img src="img/hetong.jpg" alt="">
							</div>
							<div class="title-box center-block">
								<h2>${conList.title}</h2>
								<p class="icon icon-eye"> ${conList.readnum}次阅读</p>
							</div>
						</div>
					</div>
				</a>
				</c:forEach>

			
			</div>
		</div>
	</section>




	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript">
		$(function(){

			//一级菜单选择事件
	
			$('#list-select-ul1 li').click(function() {
				var contractId = $(this).attr("id");
				location.href = "contract/list?type=" + contractId;
			});
			
			$('#list-select-ul2 li').click(
					function() {
						var contractId = $(this).data("id");
						var sId = $(this).data("s");
						location.href = "contract/list?type="+contractId+"&s="+sId;
					});
					
		});
	</script>
</body>
</html>